package com.sss.springcloud.service;

import com.sss.springcloud.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author sss
 * @date 2020-03-07 12:53
 **/
@Component
//CLOUD-PAYMENT-SERVICE服务名称 fallback是Feign组件的全局降级方法
@FeignClient(value = "CLOUD-HYSTRIX-PAYMENT-SERVICE",fallback = PaymentFeignFallBackService.class)
public interface PaymentFeignHystrixService {
    @GetMapping("/payment/hystrix/ok/{id}")
    public String ok(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    public String timeout(@PathVariable("id") Integer id);


    @GetMapping("/payment/hystrix/circuit/{id}")
    public String circuit(@PathVariable("id") Integer id);
}
